<?php
/**
 * @file
 * Header file for filter.
 *
 * Usage:
 *  - A page that wants to work with the filter should include/require this page
 *    once and only once.
 *
 * Parameter(s):
 *  - None.
 *
 * Global variable(s) set:
 *  - None.
 *
 * Global variable(s) unset:
 *  - None.
 *
 * Exception(s):
 *  - None.
 *
 * This file includes/requires:
 *  - None.
 */

// constant(s) =================================================================
// filter mask -----------------------------------------------------------------
define("VAL_FILTER_YOURSELF", 1); //!< Filter value for 'Yourself'.
define("VAL_FILTER_FRIENDS" , 2); //!< Filter value for 'Friends'.
define("VAL_FILTER_WORLD"   , 4); //!< Filter value for 'The World'.

// filter information ----------------------------------------------------------
//! Index of value in filter information.
define("FILTER_INDEX_VALUE", 0);
//! Index of default selection in filter information.
define("FILTER_INDEX_CHECKED", 1);
//! Index of label in filter information.
define("FILTER_INDEX_LABEL", 2);
//! Array of filter information (value, default selection, label).
$INFO_FILTER = array(
  array(VAL_FILTER_YOURSELF, "checked", LBL_FILTER_YOURSELF),
  array(VAL_FILTER_FRIENDS , "checked", LBL_FILTER_FRIENDS ),
  array(VAL_FILTER_WORLD   , ""       , LBL_FILTER_WORLD   )
);

// form ------------------------------------------------------------------------
define("NAME_FILTER_FORM"        , "form_filter");  //!< Filter form ID.
define("NAME_FILTER_FIELD_MASK"  , "field_filter"); //!< Filter field ID.
define("NAME_FILTER_FIELD_ROWSPP", "field_rowspp"); //!< Rows per page field ID.

// button ----------------------------------------------------------------------
//! CSS class for 'refresh' button.
define("CSS_CLASS_BUTTON_REFRESH", "ButtonRefresh");

// rows per page ---------------------------------------------------------------
//! Array of numbers of rows per page.
$VALS_ROWSPP = array(
  10,                 // 10 rows per page
  20,                 // 20 rows per page
  30                  // 30 rows per page
);
//! Default number of rows per page.
define("DEF_ROWSPP", 20);
// Placeholder for rows per page label.
define("SEARCH_ROWSPP" , "<%select%>");
//! Rows per page label.
define("LBL_ROWSPP", LBL_ROWSPP_PREFIX . SEARCH_ROWSPP . LBL_ROWSPP_SUFFIX);
//! CSS class for 'rows per page' select box.
define("CSS_CLASS_SELECT_ROWSPP", "InputRowsPP");

// pagination ------------------------------------------------------------------
define("DEF_OFFSET", 0);          //!< Default offset for retrieval of deeds.
define("DEF_LIMIT" , DEF_ROWSPP); //!< Default number of deeds to retrieve.
?>
